<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>水平垂直居中方式1</title>
  <style type="text/css">
    .box {
      width: 100px;
      height: 100px;
      padding: 30px;
      border: 1px solid #000;
    }
    .box .box1 {
      width: 100%;
      height: 100%;
      background-color: orange;
    }
  </style>
</head>
<body>
  <div class="box">
    <div class="box1"></div>
  </div>
</body>
</html>